package com.autolinq.service;

import com.autolinq.pojo.WeChatMessage;
import com.autolinq.util.http.HttpPostMessage;

public class WechatNormalEventService extends AbstractWechatService{

	@Override
	public String handleWechatMessage(WeChatMessage message,
			String qrcodePath) {
		String returnStr = "";
		if (message.getEvent().equals("subscribe")) {// 此为关注事件
			System.out.println("subscribe openID:"+message.getFromUserName());
			HttpPostMessage.postMessage(prop.getProperty("subscribeURL"), "openId="+message.getFromUserName());
			returnStr = getWechatWelcomePage(message);	

		}else if (message.getEvent().equals("unsubscribe")) {// 此为取消关注事件
			System.out.println("unsubscribe openID:"+message.getFromUserName());
			HttpPostMessage.postMessage(prop.getProperty("unsubscribeURL"), "openId="+message.getFromUserName());
		}
		return returnStr;
	}
	
}